home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
pbaseiv.zip
/
P4UTL000.TIP
< prev
next >
Wrap
Text File
|
1991-12-16
|
3KB
|
104 lines
If you use TSR (terminate and stay resident) programs such
as SideKick, you know that they can eat up precious memory.
If you need that memory back--say, to load a big
worksheet--you may have to reboot. And if the TSR is loaded
by AUTOEXEC.BAT, rebooting isn't enough; you'll have to edit
or rename AUTOEXEC.BAT first.
ALTKEY.COM is a 10-byte solution to this problem, allowing
you to choose whether your TSRs are loaded at boot time.
[It's included, in executable form, in the P4UTIL directory
on your PowerBase *.* Volume IV diskette.]
To use ALTKEY.COM, move it to a directory listed in your
PATH command, and modify your AUTOEXEC.BAT file to look
something like:
ALTKEY
IF ERRORLEVEL 8 GOTO NO-TSRS
.
.
.
[Commands to install TSRs]
.
.
.
:NO-TSRS
.
.
.
[Rest of AUTOEXEC.BAT]
Under a normal reboot, your TSRs will load. But if the <Alt>
key is held down when ALTKEY.COM executes inside
AUTOEXEC.BAT, it will return ERRORLEVEL 8, and the batch
file will skip the TSRs.
If you prefer, you can use a key other than <Alt> [see
instructions below]. Be careful with <Num Lock>, however; in
many PCs with extended keyboards, <Num Lock> is turned on
automatically at boot time.
Brian Elwood
Lincoln, Nebraska
Editor's note: ALTKEY.COM has many uses and will work
wherever you want the state of a key to influence a batch
file's execution. Changing the program to use a key like
<Num Lock> isn't necessarily a bad idea, since users don't
have to worry about holding it down; they can set the key
one way and think about something else while the batch runs.
The same is true of <Scroll Lock>, <Caps Lock>, and
<Insert>, all of which toggle their states when pushed. If
you wish to create a version of ALTKEY.COM that uses a key
other than the <Alt> key, use the <Alt-F> command to copy
the listing below into an ASCII text file called ALTKEY.SCR.
(Make sure not to delete the blank line before the line that
says `rcx'!) Then, change the "8" in the line that says MOV
AL,8 to one of the numbers in the table below, and the word
ALTKEY on the first line to something more appropriate (e.g.
NUMKEY for <Num Lock>). Finally, type DEBUG < ALTKEY.SCR at
the DOS prompt. When you use your modified program, remember
that the ERRORLEVEL returned when your chosen key is
depressed will no longer be be 8; it'll be the number you
entered in the MOV AL,<number> instruction.
ALTKEY.SCR
---- BEGIN LISTING ----
nALTKEY.COM
a100
MOV AH,2
INT 16
AND AL,8
MOV AH,4C
INT 21
rcx
a
w
q
---- END LISTING ----
Table: Codes for PC Shift Keys
Key Code
--- ----
Right Shift 1
Left Shift 2
Ctrl 4
Alt 8
Scroll Lock 16
Num Lock 32
Caps Lock 64
Insert 128
Title: Alt Alternates
Category: Misc
Issue date: Dec 1991
Editor: Brett Glass
Supplementary files: P4UTIL\ALTKEY.COM